$pd = [];
if ( $config->get( 'SiteStatsAsyncFactor' ) ) {
// Lock the table so we don't have double DB/memcached updates
- if ( !$dbw->lockIsFree( $lockKey, __METHOD__ )
- || !$dbw->lock( $lockKey, __METHOD__, 1 ) // 1 sec timeout
- ) {
+ if ( !$dbw->lock( $lockKey, __METHOD__, 0 ) ) {
$this->doUpdatePendingDeltas();
return;
$lockKey = wfWikiID() . ':recentchanges-prune';
$dbw = wfGetDB( DB_MASTER );
- if ( !$dbw->lockIsFree( $lockKey, __METHOD__ )
- || !$dbw->lock( $lockKey, __METHOD__, 1 )
- ) {
- return; // already in progress
+ if ( !$dbw->lock( $lockKey, __METHOD__, 0 ) ) {
+ // already in progress
+ return;
}
$factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$dbw->setSessionOptions( [ 'connTimeout' => 900 ] );
$lockKey = wfWikiID() . '-activeusers';
- if ( !$dbw->lockIsFree( $lockKey, __METHOD__ ) || !$dbw->lock( $lockKey, __METHOD__, 1 ) ) {
+ if ( !$dbw->lock( $lockKey, __METHOD__, 0 ) ) {
// Exclusive update (avoids duplicate entries)… it's usually fine to just drop out here,
// if the Job is already running.
return;